* progmodes/etags.el (tags-completion-at-point-function): Improve last fix.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 21 Mar 2012 17:50:28 +0000 (13:50 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 21 Mar 2012 17:50:28 +0000 (13:50 -0400)
lisp/ChangeLog
lisp/progmodes/etags.el

index 50d333709573e7135505b14f722eb97ff3ec08c7..832f278ecf9bfc72c86b86663b8ceecd52917976 100644 (file)
@@ -1,5 +1,8 @@
 2012-03-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * progmodes/etags.el (tags-completion-at-point-function):
+       Improve last fix.
+
        * files.el (move-file-to-trash): Files aren't regexps (bug#11055).
 
 2012-03-21  Sam Steingold  <sds@gnu.org>
index 3a36410884f10f6fe2fb69691e16f0ffc2b5b9ec..4b337e1c15c3d8d8c4f83a323ec8077dd2a44a7e 100644 (file)
@@ -809,10 +809,11 @@ If no tags table is loaded, do nothing and return nil."
          beg)
       (when pattern
        (save-excursion
-         (when (search-backward pattern nil t) ; will fail inside pattern
-            (setq beg (point))
-            (forward-char (length pattern))
-            (list beg (point) (tags-lazy-completion-table) :exclusive 'no)))))))
+          (forward-char (1- (length pattern)))
+          (search-backward pattern)
+          (setq beg (point))
+          (forward-char (length pattern))
+          (list beg (point) (tags-lazy-completion-table) :exclusive 'no))))))
 \f
 (defun find-tag-tag (string)
   "Read a tag name, with defaulting and completion."